package com.nova.scenic.projectlibs.util;

import android.app.Application;
import android.content.res.Configuration;

import com.nova.scenic.projectlibs.util.debug.MyLog;
import com.nova.scenic.projectlibs.util.lifecyclehelper.LifeCycleHelper;
import com.nova.scenic.projectlibs.util.lifecyclehelper.LifeCycleLogHelper;

/**
 * Created by scenic on 16/6/4.
 */
public class BaseApplication extends Application {

    public static boolean isInDebugMode = true;

    private LifeCycleHelper helper = new LifeCycleLogHelper(null){

        @Override
        public String getObjectInstance() {
            return "@"+ MyLog.getInstanceName(BaseApplication.this);
        }
    };

    @Override
    public void onCreate() {
        super.onCreate();
        if(helper != null){
            helper.onCreate();
        }
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        if(helper != null){
            helper.onConfigurationChanged(newConfig);
        }
        super.onConfigurationChanged(newConfig);
    }

    @Override
    public void onLowMemory() {
        super.onLowMemory();
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
    }

    @Override
    public void onTrimMemory(int level) {
        super.onTrimMemory(level);
    }

}
